
var state = {
    status:function (id, url)
    {
        $.ajax({
            url: url,
            type: "post",
            dataType: "json",
            data: "id=" + id,
            success: function (data) {
                if (data.code == 1 && data.msg !== "抱歉，您没有操作权限") {
                    var a = '<span class="label label-danger">禁用</span>'
                    $('#zt' + id).html(a);
                    layer.msg(data.msg, {icon: 2, time: 1500, shade: 0.1});
                    return false;
                } else if (data.code == 0 && data.msg !== "抱歉，您没有操作权限") {
                    var b = '<span class="label label-info">开启</span>'
                    $('#zt' + id).html(b);
                    layer.msg(data.msg, {icon: 1, time: 1500, shade: 0.1});
                    return false;
                } else if (data.msg == "抱歉，您没有操作权限") {
                    layer.msg(data.msg, {icon: 7, time: 1500, shade: 0.1});
                    return false;
                }
            }
        });
    },


}